package com.zyl.blog.CogniSphere.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * @version v1.0
 * @ProjectName: Personal_Blog_Server
 * @Package: com.zyl.blog.CogniSphere.model
 * @ClassName: SparkResponse
 * @Description: 星火AI响应实体
 * @Author FinalFantasy
 * @Date 2025/8/15-10:41
 */
@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class SparkResponse {

    /**
     * 回应头
     */
    private Header header;

    /**
     * 回应体
     */
    private Payload payload;

    @Data
    @ToString
    @AllArgsConstructor
    @NoArgsConstructor
    @Accessors(chain = true)
    public static class Header {

        /**
         * 状态码
         */
        private Integer code;

        /**
         * 消息
         */
        private String message;
    }

    @Data
    @ToString
    @AllArgsConstructor
    @NoArgsConstructor
    @Accessors(chain = true)
    public static class Payload {

        /**
         * 对话id
         */
        private Choices choices;
    }

    @Data
    @ToString
    @AllArgsConstructor
    @NoArgsConstructor
    @Accessors(chain = true)
    public static class Choices {
        /**
         * 状态 1表示继续，2表示结束
         */
        private int status;

        /**
         * 内容
         */
        private List<Content> text;

        @Data
        @ToString
        @AllArgsConstructor
        @NoArgsConstructor
        @Accessors(chain = true)
        public static class Content {

            /**
             * 角色
             */
            private String role;

            /**
             * 内容
             */
            private String content;
        }
    }
}